home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 05-08.C < prev    next >
Text File  |  1992-01-31  |  678b  |  40 lines

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. #define COLORS 16
  6. #define WIDTH  40
  7.  
  8. void main()
  9. {
  10.    int base;
  11.    int color;
  12.    int minx, maxx;
  13.    int mode;
  14.  
  15.    mode = fg_getmode();
  16.    fg_setmode(16);
  17.  
  18.    base = 0;
  19.    minx = 0;
  20.    maxx = WIDTH - 1;
  21.  
  22.    for (color = 0; color < COLORS; color++) {
  23.       fg_palette(color,0);
  24.       fg_setcolor(color);
  25.       fg_rect(minx,maxx,0,349);
  26.       minx = maxx + 1;
  27.       maxx = maxx + WIDTH;
  28.       }
  29.  
  30.    while (base < COLORS*4) {
  31.       for (color = 0; color < COLORS; color++)
  32.          fg_palette(color,base+color);
  33.       base += COLORS;
  34.       fg_waitkey();
  35.       }
  36.  
  37.    fg_setmode(mode);
  38.    fg_reset();
  39. }
  40.